﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Beeldbankmvc.Code
{
    public static class Mediatypes
    {
        public enum MediaTypes
        {
            analog = Constants.ITEM_TYPE_ANALOG,
            digital = Constants.ITEM_TYPE_DIGITAL,
            video_animation = Constants.ITEM_TYPE_VIDEO,
            map_illustration = Constants.ITEM_TYPE_ILLUSTRATION
        }
        
        /// <summary>
        /// Returns the description of the specified media type
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string mediaTypeDescription(MediaTypes type)
        {
            string mediaTypeDescription = "";

            switch (type)
            {
                case MediaTypes.analog:
                    mediaTypeDescription = "Analoge foto";
                    break;
                case MediaTypes.digital:
                    mediaTypeDescription = "Digitale foto";
                    break;
                case MediaTypes.video_animation:
                    mediaTypeDescription = "Video/Animatie";
                    break;
                case MediaTypes.map_illustration:
                    mediaTypeDescription = "Kaart/Illustratie";
                    break;
                default:
                    break;
            }

            return mediaTypeDescription;
        }
        
        public static string photoCollectionDescription(MediaTypes type)
        {
            string mediaTypeDescription = "";

            switch (type)
            {
                case MediaTypes.analog:
                    mediaTypeDescription = "Analoge foto collectie";
                    break;
                case MediaTypes.digital:
                    mediaTypeDescription = "Digitale foto collectie";
                    break;
                case MediaTypes.video_animation:
                    mediaTypeDescription = "Video collectie";
                    break;
                case MediaTypes.map_illustration:
                    mediaTypeDescription = "Illustratie collectie";
                    break;
                default:
                    break;
            }

            return mediaTypeDescription;
        }
        
        public static MediaTypes randomType()
        {
            Random r = new Random();
            int randomNumber = r.Next(3);

            switch (randomNumber)
            {
                case 0:
                    return MediaTypes.analog;
                case 1:
                    return MediaTypes.digital;
                case 2:
                    return MediaTypes.video_animation;
                default:
                    return MediaTypes.map_illustration;
            }
        }

        public static MediaTypes digitalType()
        {
            return MediaTypes.digital;
        }
    }
}